package com.game.network.error;

import com.game.common.error.IServerError;

public enum GameCenterError implements IServerError {
    UNKNOWN(-1, "用户中心服务未知异常"),
    SDK_VERFIY_ERROR(1, "SDK验证失败"),
    OPENID_IS_EMPTY(2, "OpenId为空"),
    OPENID_LEN_ERROR(21, "OpenId长度错误"),
    SDK_TOKEN_ERROR(3, "SDK令牌错误"),
    SDK_TOKEN_LEN_ERROR(31, "SDK令牌长度错误"),
    NICKNAME_EXIST(4, "昵称已存在"),
    ZONE_ID_IS_EMPTY(5, "区服ID为空"),
    NICKNAME_IS_EMPTY(6, "昵称为空"),
    NICKNAME_LEN_ERROR(61, "昵称长度错误"),
    TOKEN_FAILED(7, "令牌验证失败"),
    NO_GAME_GATEWAY_INFO(8, "没有网关消息，无法连接游戏"),
    ;

    private int errorCode;
    private String errorDesc;
    private GameCenterError(int errorCode, String errorDesc) {
        this.errorCode = errorCode;
        this.errorDesc = errorDesc;
    }
    @Override
    public int getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorDesc() {
        return errorDesc;
    }

    @Override
    public String toString(){
        StringBuilder msg = new StringBuilder();
        msg.append("errorCode:").append(this.errorCode).append("; errorMsg:").append(this.errorDesc);
        return msg.toString();
    }
}
